home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2003 Ekstra 100 Spil / K-CD_2003_Ekstra_100_Spil.iso / Action / GLtron / GLtron-0.62-setup.exe / {app} / scripts / audio.lua next >
Text File  |  2002-12-21  |  1KB  |  64 lines

  1. function setupSoundTrack()
  2.    local i,name
  3.    for i,name in tracks do
  4.       if name == settings.current_track then
  5.      current_track_index = i
  6.      return
  7.       end
  8.    end
  9.    settings.current_track = tracks[1]
  10.    current_track_index = 1
  11. end
  12.  
  13. function nextTrack()
  14.    if current_track_index < getn(tracks) then
  15.       current_track_index = current_track_index + 1
  16.    else
  17.       current_track_index = 1
  18.    end
  19.    settings.current_track = tracks[ current_track_index ]
  20.    c_reloadTrack()
  21. end
  22.  
  23. function previousTrack()
  24.    if current_track_index > 1 then
  25.       current_track_index = current_track_index - 1
  26.    else
  27.       current_track_index = getn(tracks) 
  28.    end
  29.    settings.current_track = tracks[ current_track_index ]
  30.    c_reloadTrack()
  31. end
  32.  
  33. function MusicVolumeUp()
  34.    settings.musicVolume = settings.musicVolume + 0.05
  35.    if settings.musicVolume > 1.0 then
  36.       settings.musicVolume = 1.0
  37.    end
  38.    c_update_audio_volume()
  39. end
  40.  
  41. function MusicVolumeDown()
  42.    settings.musicVolume = settings.musicVolume - 0.05
  43.    if settings.musicVolume < 0.0 then
  44.       settings.musicVolume = 0.0
  45.    end
  46.    c_update_audio_volume()
  47. end
  48.  
  49. function FXVolumeUp()
  50.    settings.fxVolume = settings.fxVolume + 0.05
  51.    if settings.fxVolume > 1.0 then
  52.       settings.fxVolume = 1.0
  53.    end
  54.    c_update_audio_volume()
  55. end
  56.  
  57. function FXVolumeDown()
  58.    settings.fxVolume = settings.fxVolume - 0.05
  59.    if settings.fxVolume < 0.0 then
  60.       settings.fxVolume = 0.0
  61.    end
  62.    c_update_audio_volume()
  63. end
  64.